home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / c2man-2.0pl33.lha / c2man-2.0 / config_h.SH < prev    next >
Encoding:
Text File  |  1995-01-24  |  10.1 KB  |  342 lines

  1. case $CONFIG in
  2. '')
  3.     if test -f config.sh; then TOP=.;
  4.     elif test -f ../config.sh; then TOP=..;
  5.     elif test -f ../../config.sh; then TOP=../..;
  6.     elif test -f ../../../config.sh; then TOP=../../..;
  7.     elif test -f ../../../../config.sh; then TOP=../../../..;
  8.     else
  9.         echo "Can't find config.sh."; exit 1
  10.     fi
  11.     . $TOP/config.sh
  12.     ;;
  13. esac
  14. case "$0" in
  15. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  16. esac
  17. echo "Extracting config.h (with variable substitutions)"
  18. sed <<!GROK!THIS! >config.h -e 's!^#undef!/\*#define!' -e 's!^#un-def!#undef!'
  19. /*
  20.  * This file was produced by running the config_h.SH script, which
  21.  * gets its values from config.sh, which is generally produced by
  22.  * running Configure.
  23.  *
  24.  * Feel free to modify any of this as the need arises.  Note, however,
  25.  * that running config.h.SH again will wipe out any changes you've made.
  26.  * For a more permanent change edit config.sh and rerun config.h.SH.
  27.  *
  28.  * \$Id: config_h.SH,v 2.0.1.16 1994/05/20 01:18:45 greyham Exp $
  29.  */
  30.  
  31. /* Configuration time: $cf_time
  32.  * Configured by: $cf_by
  33.  * Target system: $myuname
  34.  */
  35.  
  36. #ifndef _config_h_
  37. #define _config_h_
  38.  
  39. /* VMS:
  40.  *    This symbol, if defined, indicates that the program is running under
  41.  *    VMS.  It is currently only set in conjunction with the EUNICE symbol.
  42.  */
  43. /* BSD:
  44.  *    This symbol, if defined, indicates that the program is running under
  45.  *    a BSD system.
  46.  */
  47. #$d_eunice VMS        /**/
  48. #$d_bsd BSD        /**/
  49.  
  50. /* CPP_FILE_COM:
  51.  *    This symbol contains the first part of the string which will invoke
  52.  *    the C preprocessor a file and produce to standard output, preserving
  53.  *    comments. Typical value of "cc -E -C" or "/lib/cpp -C".
  54.  */
  55. /* CPP_STDIN_FLAGS:
  56.  *    This variable contains any flags necessary to get CPP_FILE_COM to
  57.  *    read from the standard input.
  58.  */
  59. /* CPP_IGN_HDRS:
  60.  *    This symbol is defined if CPP_FILE_COM ignores *.h files.
  61.  */
  62. /* CPP_CAN_STDIN:
  63.  *    This symbol is defined if CPP_FILE_COM can read standard input
  64.  *    directly.
  65.  */
  66. #define CPP_FILE_COM "$cppfilecom"
  67. #define CPP_STDIN_FLAGS "$cppstdinflags"
  68. #$d_cppignhdrs CPP_IGN_HDRS        /* does CPP ignore .h files? */
  69. #$d_cppcanstdin CPP_CAN_STDIN     /* can CPP read stdin directly? */
  70.  
  71. /* HAS_ACCESS:
  72.  *    This manifest constant lets the C program know that the access()
  73.  *    system call is available to check for accessibility using real UID/GID.
  74.  *    (always present on UNIX.)
  75.  */
  76. #$d_access HAS_ACCESS        /**/
  77.  
  78. /* HASCONST:
  79.  *    This symbol, if defined, indicates that this C compiler knows about
  80.  *    the const type. There is no need to actually test for that symbol
  81.  *    within your programs. The mere use of the "const" keyword will
  82.  *    trigger the necessary tests.
  83.  */
  84. #$d_const HASCONST    /**/
  85. #ifndef HASCONST
  86. #define const
  87. #endif
  88.  
  89. /* FLEXFILENAMES:
  90.  *    This symbol, if defined, indicates that the system supports filenames
  91.  *    longer than 14 characters.
  92.  */
  93. #$d_flexfnam    FLEXFILENAMES        /**/
  94.  
  95. /* HAS_LINK:
  96.  *    This symbol, if defined, indicates that the link routine is
  97.  *    available to create hard links.
  98.  */
  99. #$d_link HAS_LINK    /**/
  100.  
  101. /* HAS_OPEN3:
  102.  *    This manifest constant lets the C program know that the three
  103.  *    argument form of open(2) is available.
  104.  */
  105. #$d_open3 HAS_OPEN3        /**/
  106.  
  107. /* HAS_STRCHR:
  108.  *    This symbol is defined to indicate that the strchr()/strrchr()
  109.  *    functions are available for string searching. If not, try the
  110.  *    index()/rindex() pair.
  111.  */
  112. /* HAS_INDEX:
  113.  *    This symbol is defined to indicate that the index()/rindex()
  114.  *    functions are available for string searching.
  115.  */
  116. #$d_strchr HAS_STRCHR    /**/
  117. #$d_index HAS_INDEX    /**/
  118.  
  119. /* HAS_STRFTIME:
  120.  *    This symbol, if defined, indicates that the strftime routine is
  121.  *    available to format locale-specific times.
  122.  */
  123. #$d_strftime HAS_STRFTIME    /**/
  124.  
  125. /* HAS_STRSTR:
  126.  *    This symbol, if defined, indicates that the strstr routine is
  127.  *    available to find substrings.
  128.  */
  129. #$d_strstr HAS_STRSTR    /**/
  130.  
  131. /* HAS_SYMLINK:
  132.  *    This symbol, if defined, indicates that the symlink routine is available
  133.  *    to create symbolic links.
  134.  */
  135. #$d_symlink HAS_SYMLINK    /**/
  136.  
  137. /* Time_t:
  138.  *    This symbol holds the type returned by time(). It can be long,
  139.  *    or time_t on BSD sites (in which case <sys/types.h> should be
  140.  *    included).
  141.  */
  142. #define Time_t $timetype        /* Time type */
  143.  
  144. /* Signal_t:
  145.  *    This symbol's value is either "void" or "int", corresponding to the
  146.  *    appropriate return type of a signal handler.  Thus, you can declare
  147.  *    a signal handler using "Signal_t (*handler)()", and define the
  148.  *    handler using "Signal_t handler(sig)".
  149.  */
  150. #define Signal_t $signal_t    /* Signal handler's return type */
  151.  
  152. /* HASVOLATILE:
  153.  *    This symbol, if defined, indicates that this C compiler knows about
  154.  *    the volatile declaration.
  155.  */
  156. #$d_volatile    HASVOLATILE    /**/
  157. #ifndef HASVOLATILE
  158. #define volatile
  159. #endif
  160.  
  161. /* I_FCNTL:
  162.  *    This manifest constant tells the C program to include <fcntl.h>.
  163.  */
  164. #$i_fcntl I_FCNTL    /**/
  165.  
  166. /* I_STDDEF:
  167.  *    This symbol, if defined, indicates that <stddef.h> exists and should
  168.  *    be included.
  169.  */
  170. #$i_stddef I_STDDEF    /**/
  171.  
  172. /* I_STDLIB:
  173.  *    This symbol, if defined, indicates that <stdlib.h> exists and should
  174.  *    be included.
  175.  */
  176. #$i_stdlib I_STDLIB        /**/
  177.  
  178. /* I_STRING:
  179.  *    This symbol, if defined, indicates to the C program that it should
  180.  *    include <string.h> (USG systems) instead of <strings.h> (BSD systems).
  181.  */
  182. #$i_string I_STRING        /**/
  183.  
  184. /* I_SYS_FILE:
  185.  *    This symbol, if defined, indicates to the C program that it should
  186.  *    include <sys/file.h> to get definition of R_OK and friends.
  187.  */
  188. #$i_sysfile I_SYS_FILE        /**/
  189.  
  190. /* I_SYS_TYPES:
  191.  *    This symbol, if defined, indicates to the C program that it should
  192.  *    include <sys/types.h>.
  193.  */
  194. #$i_systypes    I_SYS_TYPES        /**/
  195.  
  196. /* I_TIME:
  197.  *    This symbol, if defined, indicates to the C program that it should
  198.  *    include <time.h>.
  199.  */
  200. /* I_SYS_TIME:
  201.  *    This symbol, if defined, indicates to the C program that it should
  202.  *    include <sys/time.h>.
  203.  */
  204. #$i_time I_TIME        /**/
  205. #$i_systime I_SYS_TIME        /**/
  206.  
  207. /* I_UNISTD:
  208.  *    This symbol, if defined, indicates to the C program that it should
  209.  *    include <unistd.h>.
  210.  */
  211. #$i_unistd I_UNISTD        /**/
  212.  
  213. /* I_STDARG:
  214.  *    This symbol, if defined, indicates that <stdarg.h> exists and should
  215.  *    be included.
  216.  */
  217. /* I_VARARGS:
  218.  *    This symbol, if defined, indicates to the C program that it should
  219.  *    include <varargs.h>.
  220.  */
  221. #$i_stdarg I_STDARG        /**/
  222. #$i_varargs I_VARARGS    /**/
  223.  
  224. /* CAN_PROTOTYPE:
  225.  *    If defined, this macro indicates that the C compiler can handle
  226.  *    function prototypes.
  227.  */
  228. /* DOTS:
  229.  *    This macro is used to specify the ... in function prototypes which
  230.  *    have arbitrary additional arguments.
  231.  */
  232. /* NXT_ARG:
  233.  *    This macro is used to separate arguments in the declared argument list.
  234.  */
  235. /* P_FUNC:
  236.  *    This macro is used to declare "private" (static) functions.
  237.  *    It takes three arguments: the function type and name, a parenthesized
  238.  *    traditional (comma separated) argument list, and the declared argument
  239.  *    list (in which arguments are separated with NXT_ARG, and additional
  240.  *    arbitrary arguments are specified with DOTS).  For example:
  241.  *
  242.  *        P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
  243.  */
  244. /* P_FUNC_VOID:
  245.  *    This macro is used to declare "private" (static) functions that have
  246.  *    no arguments.  The macro takes one argument: the function type and name.
  247.  *    For example:
  248.  *
  249.  *        P_FUNC_VOID(int subr)
  250.  */
  251. /* V_FUNC:
  252.  *    This macro is used to declare "public" (non-static) functions.
  253.  *    It takes three arguments: the function type and name, a parenthesized
  254.  *    traditional (comma separated) argument list, and the declared argument
  255.  *    list (in which arguments are separated with NXT_ARG, and additional
  256.  *    arbitrary arguments are specified with DOTS).  For example:
  257.  *
  258.  *        V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
  259.  */
  260. /* V_FUNC_VOID:
  261.  *    This macro is used to declare "public" (non-static) functions that have
  262.  *    no arguments.  The macro takes one argument: the function type and name.
  263.  *    For example:
  264.  *
  265.  *        V_FUNC_VOID(int fork)
  266.  */
  267. /* _:
  268.  *    This macro is used to declare function parameters for folks who want
  269.  *    to make declarations with prototypes using a different style than
  270.  *    the above macros.  Use double parentheses.  For example:
  271.  *
  272.  *        int main _((int argc, char *argv[]));
  273.  */
  274. #$prototype    CAN_PROTOTYPE    /**/
  275. #ifdef CAN_PROTOTYPE
  276. #define    NXT_ARG ,
  277. #define    DOTS , ...
  278. #define    V_FUNC(name, arglist, args)name(args)
  279. #define    P_FUNC(name, arglist, args)static name(args)
  280. #define    V_FUNC_VOID(name)name(void)
  281. #define    P_FUNC_VOID(name)static name(void)
  282. #define    _(args) args
  283. #else
  284. #define    NXT_ARG ;
  285. #define    DOTS
  286. #define    V_FUNC(name, arglist, args)name arglist args;
  287. #define    P_FUNC(name, arglist, args)static name arglist args;
  288. #define    V_FUNC_VOID(name)name()
  289. #define    P_FUNC_VOID(name)static name()
  290. #define    _(args) ()
  291. #endif
  292.  
  293. /* CAN_VAPROTO:
  294.  *    This variable is defined on systems supporting prototype declaration
  295.  *    of functions with a variable number of arguments.
  296.  */
  297. /* _V:
  298.  *    This macro is used to declare function parameters in prototypes for
  299.  *    functions with a variable number of parameters. Use double parentheses.
  300.  *    For example:
  301.  *
  302.  *        int printf _V((char *fmt, ...));
  303.  *
  304.  *    Remember to use the plain simple _() macro when declaring a function
  305.  *    with no variable number of arguments, since it might be possible to
  306.  *    have a non-effect _V() macro and still get prototypes via _().
  307.  */
  308. #$vaproto CAN_VAPROTO    /**/
  309. #ifdef CAN_VAPROTO
  310. #define    _V(args) args
  311. #else
  312. #define    _V(args) ()
  313. #endif
  314.  
  315. /* VOIDFLAGS:
  316.  *    This symbol indicates how much support of the void type is given by this
  317.  *    compiler.  What various bits mean:
  318.  *
  319.  *        1 = supports declaration of void
  320.  *        2 = supports arrays of pointers to functions returning void
  321.  *        4 = supports comparisons between pointers to void functions and
  322.  *            addresses of void functions
  323.  *        8 = suports declaration of generic void pointers
  324.  *
  325.  *    The package designer should define VOIDUSED to indicate the requirements
  326.  *    of the package.  This can be done either by #defining VOIDUSED before
  327.  *    including config.h, or by defining defvoidused in Myinit.U.  If the
  328.  *    latter approach is taken, only those flags will be tested.  If the
  329.  *    level of void support necessary is not present, defines void to int.
  330.  */
  331. #ifndef VOIDUSED
  332. #define VOIDUSED $defvoidused
  333. #endif
  334. #define VOIDFLAGS $voidflags
  335. #if (VOIDFLAGS & VOIDUSED) != VOIDUSED
  336. #define void int        /* is void to be avoided? */
  337. #define M_VOID            /* Xenix strikes again */
  338. #endif
  339.  
  340. #endif
  341. !GROK!THIS!
  342.